home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / ProgramFilesFolder / jre / lib / jvm.jcov.txt < prev    next >
Encoding:
Text File  |  2003-10-02  |  4.7 KB  |  103 lines

  1. version : @(#)jvm.jcov.txt    1.2 01/07/13
  2.         JCOV support in JDK1.3 and later
  3.  
  4. Up to JDK1.2.x Jcov runtime support has been an integral part of the
  5. debug version of the Javasoft's JVM, therefore it could not work with
  6. any other JVMs. In JDK1.3 all Jcov support was isolated in a separate
  7. library and implemented basing upon the Java Virtual Machine Profiler
  8. Interface (JVMPI), so it theoretically can work with any JVM that
  9. support JVMPI. This library is loaded by a JVM at its startup, if the
  10. -Xrunjcov option is specified. For more information about how JVM finds
  11. and loads libraries passed via the -Xrun<libname> JVM's option, please
  12. consult JVMPI docs.
  13.  
  14. usage:
  15.  
  16. java [other java options] -Xrunjcov[:][help]|[<option>=<value>, ...] classname
  17.  
  18. where <option> is the name of an option, <value> is its value. The
  19. recognized command-line options are :
  20.  
  21. include(i)=<class name prefix>
  22.     makes Jcov profile only those classes whose names begin with given
  23.     class name prefix. This option may be specified multiple times - in
  24.     this case class name must satisfy at least one of the class name
  25.     prefixes to be profiled.
  26. exclude(e)=<class name prefix>
  27.     tells Jcov not to profile classes whose names begin with given
  28.     class name prefix. This option may be given multiple times - if a
  29.     class name satisfies at least one of the class name prefixes then
  30.     it will not be profiled.
  31. type(t)=<value>
  32.     value can be either B or M. Sets jcov data gathering mode : in B
  33.     mode method/block/branch coverage data is gathered, in M only
  34.     method coverage data is gathered. Default value is B.
  35. file(f)=<filename>
  36.     specifies savefile name, default - java.jcov.
  37. caller_include(ci)=<class name prefix>
  38.     gather coverage data only for methods invoked from the specified
  39.     class or classes beloning to the specified package;
  40.     the option can be used multiple times;
  41.     class or package names should use '.' as a package separator
  42. caller_exclude(ce)=<class name prefix>
  43.     gather coverage data only for methods invoked *not* from the specified
  44.     class or classes *not* beloning to the specified package;
  45.     the option can be used multiple times;
  46.     class or package names should use '.' as a package separator
  47. abstract_methods(am)=<on|off>
  48.     store/do not store jcov data for abstract methods; default is 'off'
  49. overwrite(o)=<on|off>
  50.     overwrite jcov data file; default is 'off' (jcov data is merged)
  51. options_file(of)=<filename>
  52.     specifies where to read options from; (caller_)include/(caller_)exclude
  53.     options values read from the file are added to those, specified in the
  54.     command line
  55.  
  56. Example 1.
  57. (JDK 1.3.0 ):
  58.     N/A
  59.  
  60. (JDK 1.3.1 - 1.4.0 only)
  61.     > java -XX:+EnableJVMPIInstructionStartEvent -Xrunjcov <class>
  62.  
  63. This command will make Jcov profile all loaded classes which have the
  64. CoverageTable class attribute (i.e. all loaded classes which had been
  65. compiled with the -Xjcov compiler option) and save method/block/branch
  66. coverage data to a file named java.jcov in current directory.
  67.  
  68. Example 2.
  69. (JDK 1.4.0 only, in earlier JDKs full option names must be used)
  70.     > java -Xrunjcov:i=java,e=java.lang,e=java.io,type=M,file=/tmp/sys.jcov <class>
  71.  
  72. This command will make Jcov profile all classes from the java package
  73. and its subpackages except java.lang and java.io, only method coverage
  74. statistics will be gathered and saved to a file named sys.jcov' in the
  75. /tmp directory.
  76.  
  77. Notes:
  78.  
  79.   1.JVM must not be run in debug mode (-Xdebug option must not be
  80.     specified), since Jcov cannot work correctly in this
  81.     JVM's mode.  
  82.   2.When gathered data is saved to an existing Jcov data
  83.     file, then it is merged (on per-class basis) with the corresponding
  84.     data found in the file. If the data types of two classes being
  85.     merged don't match, then both classes are saved in the resulting
  86.     jcov data file.
  87.   3.(JDK 1.2.x and earlier) For Jcov to work correctly any JIT compiler
  88.     must be turned off (for example, by specifying the -Djava.compiler=NONE
  89.     JVM's option)
  90.   4.If a class or an interface contains only abstract methods then it will
  91.     not be profiled at all (i.e. no code coverage data will be gathered
  92.     for it).
  93.   5.Only non-abstract methods are profiled.
  94.   6.If data gathering mode is set to B then those classes, having no
  95.     CoverageTable or CharacterRangeTable class attribute, will not be profiled.
  96.   7.For Jcov to be able to gather block/branch coverage data for a certain
  97.     class, this class must have CoverageTable class attribute. This can be
  98.     achived by compiling this class with the -prof=jcov (JDK1.1 - JDK
  99.     1.1.x) option or the -Xjcov (JDK1.2 - JDK 1.2.x, JDK 1.4) option. With
  100.     JDK 1.3.0-1.3.1 'oldjavac -Xjcov' command should be used.
  101.   8.-XX:+EnableJVMPIInstructionStartEvent JVM option has to be specified in
  102.     JDK
  103.